#ifndef PRICEDELEGATE_H
#define PRICEDELEGATE_H

#include <QStyledItemDelegate>

class QStyleOptionViewItem;
class QAbstractItemModel;
class QModelIndex;

class PriceDelegate : public QStyledItemDelegate
{
    Q_OBJECT

public:
    explicit PriceDelegate(QObject *parent = 0);

    static const QString textFromValue(int price);
    static const int dataRole();

    virtual QWidget *createEditor(
        QWidget *parent
    ,   const QStyleOptionViewItem &option
    ,   const QModelIndex &index) const;

    virtual void setEditorData(
        QWidget *editor
    ,   const QModelIndex &index) const;

    virtual void setModelData(
        QWidget *editor
    ,   QAbstractItemModel *model
    ,   const QModelIndex &index) const;

    virtual void updateEditorGeometry(
        QWidget *editor
    ,   const QStyleOptionViewItem &option
    ,   const QModelIndex &index) const;
};

#endif // PRICEDELEGATE_H
